const mysql = require("mysql");

const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: 'root',
  database: 'dbtest'  //是几个圆饼图标的数据库的名字，不是有小鲸鱼图标连接m名
});
connection.connect()

var delSql = "DELETE FROM emp where id = 4";
//删
connection.query(delSql, function (err, result) {
  if (err) {
    console.log('[DELETE ERROR]', err.message);
    return
  }
  console.log('---------------delete-----------------');
  console.log('DELETE affectedRows',result.affectedRows);
})
connection.end();